<template>
    <div>
        <div align="center" style="font-weight: bold;font-size: 20px;margin-bottom: 20px;">{{showMonth}}船代统计表</div>
        <table border="1" cellspacing="0" style="width: 1100px;text-align: center;" >
            <tr>
                <td rowspan="3" width="10%">单位\项目</td>
                <td colspan="8">箱量(TEU)</td>
                <td colspan="6">合同执行价(元)</td>
            </tr>
            <tr>
                <td colspan="4">本月</td>
                <td colspan="4">累计</td>
                <td colspan="3">本月</td>
                <td colspan="3">累计</td>
            </tr>
            <tr>
                <td>箱量</td>
                <td>同期</td>
                <td>同比</td>
                <td>环比</td>
                <td>箱量</td>
                <td>同期</td>
                <td>同比</td>
                <td>环比</td>
                <td>金额</td>
                <td>同期</td>
                <td>同比</td>
                <td>金额</td>
                <td>同期</td>
                <td>同比</td>
            </tr>
            <tr v-for="item of list">
                <td>{{item.accountUnit}}</td>
                <td>{{item.monthTue}}</td>
                <td>{{item.monthStage}}</td>
                <td>{{item.monthCompare == null ? "/" : (Number(item.monthCompare*100).toFixed(2)+"%")}}</td>
                <td>{{item.monthRing == null ? "/" : (Number(item.monthRing*100).toFixed(2)+"%")}}</td>
                <td>{{item.totalTue}}</td>
                <td>{{item.totalStage}}</td>
                <td>{{item.totalCompare == null ? "/" : (Number(item.totalCompare*100).toFixed(2)+"%")}}</td>
                <td>{{item.totalRing == null ? "/" : (Number(item.totalRing*100).toFixed(2)+"%")}}</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr v-if="list.length == 0">
                <td colspan="15" style="text-align: center;">暂无数据</td>
            </tr>
        </table>
    </div>
</template>

<script>
    import { getOperationTotalReportByMonth } from "@/api/balance/balance";

    export default {
        name: "monthShipName",
        data() {
            return {
                showMonth :'',
                list : []
            }
        },
        created() {
            this.loadData()
        },
        methods: {
            loadData() {
                this.showMonth=this.$route.query.factShowTime
                this.list = JSON.parse(localStorage.getItem('monthReportShipName'))
                this.$nextTick(() => {
                    window.print()
                    window.close();
                })
            }
        }
    }
</script>

<style scoped>

</style>
